<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<?php
		$BASE_URL = str_replace('\\','/',Yii::app()->theme->baseUrl);
		Yii::app()->clientScript->registerCssFile($BASE_URL.'/css/style.css');
		Yii::app()->clientScript->registerScriptFile($BASE_URL.'/jquery/main.js');
	?>
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>
<body>
		<div class="topMenu">
			<ul>
				<li><span>Сайт</span>
					<ul>
						<li><a href="/" target="_blank">Просмотр</a></li>
						<li><a href="/adminArea/login/logout">Выход</a></li>
					</ul>
				</li>
			</ul>
			<? $this->widget('adminArea.components.widgets.AAdminMenu'); ?>
			<ul style="position:absolute;right: 0;">
				<li><span>Справка</span>
					<ul style="right: 0;">
						<li><a href="/adminArea/info/systemInfo/">О системе</a></li>
						<li><a href="#" onclick="createWindow('aboutSystem',{modal: true,title: 'Статистика',width: '400'}, true);return false;">Статистика</a></li>
					</ul>
				</li>
			</ul>
		</div>

		<div class="path">
			<?php if(isset($this->breadcrumbs)):?>
				<?php $this->widget('zii.widgets.CBreadcrumbs', array(
					'links'=>$this->breadcrumbs,
					'homeLink'=>false,
				)); ?>
			<?php endif?>
		</div>

		<div class="user">
			Logged in as: <?= Yii::app()->user->getName() ?>
		</div>

		<div class='body'>
			<?php
				echo $content;
			?>
			<div id="aboutSystem" style="display: none;">
				<? list($queryCount, $queryTime) = Yii::app()->db->getStats(); ?>
				<table style="width: 100%;">
					<tr>
						<td style="width: 59%;"><?=Yii::t('core','Execution time')?>:</td>
						<td><?=sprintf('%0.5f',Yii::getLogger()->getExecutionTime())?> <?=Yii::t('core','sec')?>.</td>
					</tr>
					<tr>
						<td><?=Yii::t('core','Memory usage')?>:</td>
						<td><?=round(memory_get_peak_usage()/(1024*1024),2)?> <?=Yii::t('core','Mb')?>.</td>
					</tr>
					<tr>
						<td><?=Yii::t('core','Query count')?>:</td>
						<td><?=$queryCount?></td>
					</tr>
					<tr>
						<td><?=Yii::t('core','Total query time')?>:</td>
						<td><?=sprintf('%0.5f',$queryTime)?> <?=Yii::t('core','sec')?>.</td>
					</tr>
				</table>
			</div>
		</div>

	<div id="imageUploadWindow" style="display: none;">
		<table cellpadding="0" cellspacing="0" width="100%" class="imageForm">
			<form action="/adminArea/imageUpload/" method="post" enctype="multipart/form-data">
				<tr>
					<td style="width: 1%;"><?= Yii::t('imageInput', 'Select the file') ?>: </td>
					<td><input type="file" name="file"></td>
				</tr>
				<tr>
					<td><?= Yii::t('imageInput', 'Alternative text') ?>: </td>
					<td><input type="text" name="alt"></td>
				</tr>
			</form>
		</table>
	</div>

	<? $this->widget('application.components.AMessage.AMessage'); ?>
	</body>
</html>